<?php

Class Basic_article_to {
	
	private $number;
	private $title;
	private $autor;
	private $date;
	private $basic_categories;
	private $description;
	private $links;
	private $image;
	private $video;
	
	
	public function __construct($number, $title, $autor, $date, $basic_categories, 
									$description, $links, $image, $video) {
		$this->number = $number;
		$this->title = $title;
		$this->autor = $autor;
		$this->date = $date;
		$this->basic_categories = $basic_categories;
		$this->description = $description;
		$this->links = $links;
		$this->image = $image;
		$this->video = $video;
	}
	
	public function get_number() {
		return $this->number;
	}
	
	public function get_title() {
		return $this->title;
	}
	
	public function get_autor() {
		return $this->autor;
	}
	
	public function get_date() {
		return $this->date;
	}
	
	public function get_basic_categories() {
		return $this->basic_categories;
	}
	
	public function get_description() {
		return $this->description;
	}
	
	public function get_links() {
		return $this->links;
	}
	
	public function get_image() {
		return $this->image;
	}
	
	public function get_video() {
		return $this->video;
	}
	
	public function equals($object) {
		if ((get_class($this) != get_class($object)) ||
				($object == null))				
			 return false;
		else {
			if (($this->number == $object->get_number()) &&
				($this->title == $object->get_title()) &&
				($this->autor == $object->get_autor()) &&
				($this->date == $object->get_date()) &&
				($this->basic_categories == $object->get_basic_categories()) &&
				($this->description == $object->get_description()) &&
				($this->links == $object->get_links()) &&
				($this->image == $object->get_image()) &&
				($this->video = $object->get_video()))
				return true;
			return false;
		}
	}
	
	public function to_string() {
		$string = 'number: ' . $this->number . ' | ' .
					'title: ' . $this->title . ' | ' .
					'autor: '	. $this->autor . ' | ' .
					'date: '	. $this->date . ' | ';
		$string = $string . 'categories: ';		
		foreach ($this->basic_categories as $category) 
			$string = $string . $category->to_string() . ' | ';
		if (!$this->description == NULL)
			$string = $string . 'description: '	. $this->description->to_string() . ' | ';
		$string = $string . 'links: ';		
		foreach ($this->links as $link) 
			$string = $string . $link->to_string() . ' | ';
		if (!$this->image == NULL)
			$string = $string . 'image: '	. $this->image->to_string() . ' | ';
		if (!$this->video == NULL)
		$string = $string . 'video: '	. $this->video->to_string();
		
		return $string;						
	}

}

?>